import selectors

from FPDLCore.FileDownloadClient import FileDownloadClient

if __name__ == '__main__':
    sel = selectors.DefaultSelector()

    client = FileDownloadClient(sel, '/root/web/Berserk - 24 (BD 960x720 AVC AAC).mp4', 'e:/temp/Berserk - 24 (BD 960x720 AVC AAC).mp4')
    client.startdownload()

    while True:
        events = sel.select()
        for key, mask in events:
            callback = key.data
            callback(key.fileobj, mask)